YAHOO.namespace('Tesis.base');

YAHOO.Tesis.base.Dialog = function(elContainer, url, width, height, callback) {
    this.width = width;
    this.height = height;
    YAHOO.Tesis.base.Dialog.superclass.constructor.call(this, elContainer, this.construirConfig());
    this.callback = callback;
    this.setBody('<iframe frameborder="0" src="' + url + '" width="100%" height="100%"/>');
    this.render();
};

YAHOO.lang.extend(YAHOO.Tesis.base.Dialog, YAHOO.widget.Dialog, {
    /**
     * para ser sobrescrito, debe tener la siguiente forma:
     * return [
     *     { text: 'Guardar', handler: funcionGuardar, isDefault: true },
     *     { text: 'Salir', handler: funcionSalir, isDefault: false },
     *     etc...     
     * ];
     */
    buildButtons: function() {
        return undefined;
    },
    construirConfig: function() {
        return {
            width: this.width, 
            height: this.height,
            modal: true, 
            fixedcenter: true,
            visible: false, 
            constraintoviewport: true,
            buttons: this.buildButtons()
        };
    }
});